// components/mypublishUp/mypublishUp.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    picture: {
      type: String,
      value: ""
    },
    master: {
      type: String,
      value: "11"
    },
    address: {
      type: String,
      value: ""
    },
    time: {
      type: String,
      value: ""
    },
    avid:{
      type:String,
      value:""
    },
    category:{
      type:String,
      value:""
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
img:""
  },

  /**
   * 组件的方法列表
   */
   observers: {
    
    'avid': function() {
      var that=this;
wx.request({
  url: 'https://www.linjianyi.link/getCategoryimg',
  data:{
    avid:that.properties.avid
  },
  success(res){
that.setData({
  img:res.data
})
  }
})
    }},
  methods: {
    
    todetail(e){
      var that=this
      wx.navigateTo({
        
        url: '../../pages/detail/detail?avid='+that.properties.avid,
      })
      },
deleteA(){
  var that=this;
  wx.showModal({
    title: '提示',
    content: '确定删除此活动?',
    success: function (res) {
      if (res.confirm) {//这里是点击了确定以后
         wx.request({
    url: 'https://www.linjianyi.link/deleteav',
    data:{
      avid:that.properties.avid,
      category:that.properties.category
    },
    success(){
      var judge=true
      if(judge){
      wx.reLaunch({
        url: '../../pages/mypublish/mypublish',
      })
      judge=false
    }
    while(!judge){
      wx.showToast({
        title: '删除成功！',  // 标题
        icon: 'success',   // 图标类型，默认success
        duration: 1500   // 提示窗停留时间，默认1500ms
    })
    judge=true
  }
    }
  })
      } else {//这里是点击了取消以后
        console.log('用户点击取消')
      }
    }
  })
 
}
  }
})
